﻿<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="ForumPostsEdit.ascx.cs"
    Inherits="Micronet.OpenWeb.OpenWeb.Admin.Views.Shared.Forum.ForumPostsEdit" %>
<owc:OwDetailsView ID="ForumPostsEditDv" runat="server" AutoGenerateRows="False"
    DataSourceID="ForumPostsEditOds" DataKeyNames="ForumPostID" EnableModelValidation="True"
    OwNotificationID="" SkinID="DetailViewAdmin">
    <Fields>
        <asp:TemplateField>
            <InsertItemTemplate>
                <fieldset>
                    <legend>
                        <owc:OwR ID="GeneralInfo" runat="server" OwText="GeneralInfo"></owc:OwR>
                    </legend>
                    <div>
                        <owac:OwDetailCommonGroup ID="OwDetailCommonGroup2" runat="server" OwBindContinentLocalityValue='<%# Bind("ContinentID") %>'
                            OwBindCountryLocalityValue='<%# Bind("CountryID") %>' OwBindProvinceLocalityValue='<%# Bind("ProvinceID") %>'
                            OwBindDistrictLocalityValue='<%# Bind("DistrictID") %>' OwBindWardLocalityValue='<%# Bind("WardID")%>' />
                    </div>
                </fieldset>
                <fieldset>
                    <legend><span>
                        <owc:OwR ID="ExInfoOwR" runat="Server" OwText="ExInfoLabel" OwSuffix=":"></owc:OwR>
                    </span></legend>
                    <div>
                        <table width="100%">
                            <tr>
                                <td class="leftcolumn">
                                    <owc:OwR ID="IsDeleteOwR" runat="server" OwText="IsDeleteLabel" OwSuffix=":"></owc:OwR>
                                </td>
                                <td>
                                    <owc:OwCheckBox runat="server" ID="IsDeletedCb" Checked='<%# Bind("IsDeleted") %>' />
                                </td>
                            </tr>
                            <tr>
                                <td class="leftcolumn">
                                    <owc:OwR ID="IsApprovedOwR" runat="server" OwText="IsApprovedLabel" OwSuffix=":"></owc:OwR>
                                </td>
                                <td>
                                    <owc:OwCheckBox runat="server" ID="IsApprovedCb" Checked='<%# Bind("IsApproved") %>' />
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <asp:Localize ID="Localize6" runat="server" Text="<%$ OwR:CreatedDate %>"></asp:Localize>
                                    &nbsp;:
                                </td>
                                <td colspan="2">
                                    <owc:OwTextBox SkinID="owTextBox" ID="txtCreatedDate" runat="server" Enabled="False"
                                        Width="200px" OwDefaultValue='<%$ Ow: DateTime.Now %>' OwUsedForEdit="True" Text='<%# Bind("DateTimeCreated") %>'>
                                    </owc:OwTextBox>
                                </td>
                            </tr>
                            <tr>
                                <td class="leftcolumn">
                                    <asp:Localize ID="Localize13" Text="<%$ OwR:SortOrder %>" runat="server"></asp:Localize>
                                    :
                                </td>
                                <td>
                                    <owc:OwTextBox SkinID="owTextBox" ID="txtSortOrder" runat="server" Width="100px"
                                        Text='<%# Bind("SortOrder") %>' EmptyMessage="<%$ OwR: EnterSortOrder %>">
                                    </owc:OwTextBox>
                                </td>
                            </tr>
                        </table>
                    </div>
                </fieldset>
                <fieldset>
                    <legend><span>
                        <owc:OwR ID="InfoLabel" runat="server" OwText="InfoLabel"></owc:OwR>
                    </span></legend>
                    <div>
                        <table width="100%">
                            <tr>
                                <td class="leftcolumn">
                                    <owc:OwR ID="TitleLabelOwR" runat="server" OwText="TitleLabel" />
                                </td>
                                <td>
                                    <owc:OwTextBox SkinID="OwTextBox" ID="txtTitle" runat="server" Width="680px" OwDefaultValue=""
                                        OwUsedForEdit="False" Text='<%# Bind("Title") %>'>
                                    </owc:OwTextBox>
                                    <asp:RequiredFieldValidator Text="*" ID="RequiredFieldValidator1" runat="server"
                                        ErrorMessage=" <%$ OwR: TitleNotEmpty %>" ControlToValidate="txtTitle"></asp:RequiredFieldValidator>
                                </td>
                            </tr>
                            <tr>
                                <td class="leftcolumn">
                                    <owc:OwR ID="UserOwR" runat="server" OwText="UserLabel" />
                                </td>
                                <td>
                                    <owc:OwTextBox SkinID="owTextBox" ID="txtUser" runat="server" Enabled="False" Width="200px"
                                        OwUsedForEdit="False" Text='<%#Eval("UserID")!=null? (Membership.GetUser(Eval("UserID"))!=null?Membership.GetUser(Eval("UserID")).UserName:"n/a"):"n/a"  %>'>
                                    </owc:OwTextBox>
                                    <owc:OwTextBox SkinID="owTextBox" OwDefaultValue='<%# Membership.GetUser()!=null ? Membership.GetUser().ProviderUserKey:"" %>'
                                        ID="UserLabel" Visible="false" runat="server" Text='<%# Bind("UserID") %>' />
                                    <%--<owc:OwTextBox SkinID="OwTextBox" ID="OwTextBox2" Enabled="false" runat="server" Width="680px" OwDefaultValue=""
                                        OwUsedForEdit="False" Text='<%#Membership.GetUser().UserName%>' >
                                    </owc:OwTextBox>--%>
                                    <%--<owc:OwTextBox SkinID="OwTextBox" ID="UserTb" Visible="false" runat="server" Width="680px" OwDefaultValue='<%#Membership.GetUser().ProviderUserKey %>'
                                        OwUsedForEdit="False" Text='<%# Bind("UserID") %>' >
                                    </owc:OwTextBox>--%>
                                </td>
                            </tr>
                            <tr>
                                <td class="leftcolumn">
                                    <owc:OwR ID="CompanyOwR" runat="server" OwText="CompanyLabel" />
                                </td>
                                <td>
                                    <owc:OwComboBox SkinID="owCombobox" ID="CompanyCbb" runat="server" DataSourceID="OwCompanyOds"
                                        DataTextField="Name" DataValueField="CompanyID" AppendDataBoundItems="True" SelectedValue='<%# Bind("CompanyID") %>'>
                                    </owc:OwComboBox>
                                    <owc:OwOds ID="OwCompanyOds" runat="server" OldValuesParameterFormatString="original_{0}"
                                        OwBLLClassName="" OwSelectMethod="" SelectMethod="OwGetAll" TypeName="Micronet.OpenWeb.Com.BLL.OwCompaniesBLL">
                                        <SelectParameters>
                                            <asp:Parameter Name="sortClause" Type="String" />
                                            <asp:Parameter Name="sortDirection" Type="String" />
                                            <asp:Parameter Name="startRowIndex" Type="Int32" />
                                            <asp:Parameter Name="maximumRows" Type="Int32" />
                                        </SelectParameters>
                                    </owc:OwOds>
                                </td>
                            </tr>
                            <tr>
                                <td class="leftcolumn">
                                    <owc:OwR ID="ForumTheadOwR" runat="server" OwText="ForumTheadLabel" />
                                </td>
                                <td>
                                    <owc:OwComboBox SkinID="owCombobox" ID="OwForumTheadCbb" runat="server" DataSourceID="OwForumTheadOds"
                                        DataTextField="Title" DataValueField="ForumThreadID" AppendDataBoundItems="True"
                                        SelectedValue='<%# Bind("ForumThreadID") %>'>
                                    </owc:OwComboBox>
                                    <owc:OwOds ID="OwForumTheadOds" runat="server" OldValuesParameterFormatString="original_{0}"
                                        OwBLLClassName="" OwSelectMethod="" SelectMethod="OwGetAll" TypeName="Micronet.OpenWeb.Com.BLL.OwForumThreadsBLL">
                                        <SelectParameters>
                                            <asp:Parameter Name="sortClause" Type="String" />
                                            <asp:Parameter Name="sortDirection" Type="String" />
                                            <asp:Parameter Name="startRowIndex" Type="Int32" />
                                            <asp:Parameter Name="maximumRows" Type="Int32" />
                                        </SelectParameters>
                                    </owc:OwOds>
                                </td>
                            </tr>
                            <tr>
                                <td class="leftcolumn">
                                    <owc:OwR ID="OwDetailOwR" runat="server" OwText="DetailLabel" />
                                </td>
                                <td>
                                    <owc:OwEditor SkinID="owEditorFull" ID="txtDetail" runat="server" OwStoragePlace="Common"
                                        OwUsedTarget="Common" Style="position: relative;" Content='<%# Bind("Detail") %>'>
                                    </owc:OwEditor>
                                    <asp:RequiredFieldValidator Text="*" ID="RequiredFieldValidator3" runat="server"
                                        ControlToValidate="txtDetail" ErrorMessage=" <%$ OwR: DetailNotEmpty %>"></asp:RequiredFieldValidator>
                                </td>
                            </tr>
                        </table>
                    </div>
                </fieldset>
                &nbsp; &nbsp; &nbsp;
            </InsertItemTemplate>
            <EditItemTemplate>
                <fieldset>
                    <legend>
                        <owc:OwR ID="GeneralInfo" runat="server" OwText="GeneralInfo"></owc:OwR>
                    </legend>
                    <div>
                        <owac:OwDetailCommonGroup ID="OwDetailCommonGroup2" runat="server" OwBindContinentLocalityValue='<%# Bind("ContinentID") %>'
                            OwBindCountryLocalityValue='<%# Bind("CountryID") %>' OwBindProvinceLocalityValue='<%# Bind("ProvinceID") %>'
                            OwBindDistrictLocalityValue='<%# Bind("DistrictID") %>' OwBindWardLocalityValue='<%# Bind("WardID")%>' />
                    </div>
                </fieldset>
                <fieldset>
                    <legend><span>
                        <owc:OwR ID="ExInfoOwR" runat="Server" OwText="ExInfoLabel" OwSuffix=":"></owc:OwR>
                    </span></legend>
                    <div>
                        <table width="100%">
                            <tr>
                                <td class="leftcolumn">
                                    <owc:OwR ID="IsDeleteOwR" runat="server" OwText="IsDeleteLabel" OwSuffix=":"></owc:OwR>
                                </td>
                                <td>
                                    <owc:OwCheckBox runat="server" ID="IsDeletedCb" Checked='<%# Bind("IsDeleted") %>' />
                                </td>
                            </tr>
                            <tr>
                                <td class="leftcolumn">
                                    <owc:OwR ID="IsApprovedOwR" runat="server" OwText="IsApprovedLabel" OwSuffix=":"></owc:OwR>
                                </td>
                                <td>
                                    <owc:OwCheckBox runat="server" ID="IsApprovedCb" Checked='<%# Bind("IsApproved") %>' />
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <asp:Localize ID="Localize6" runat="server" Text="<%$ OwR:CreatedDate %>"></asp:Localize>
                                    &nbsp;:
                                </td>
                                <td colspan="2">
                                    <owc:OwTextBox SkinID="owTextBox" ID="txtCreatedDate" runat="server" Enabled="False"
                                        Width="200px" OwDefaultValue='<%$ Ow: DateTime.Now %>' OwUsedForEdit="True" Text='<%# Bind("DateTimeCreated") %>'>
                                    </owc:OwTextBox>
                                </td>
                            </tr>
                            <tr>
                                <td class="leftcolumn">
                                    <asp:Localize ID="Localize13" Text="<%$ OwR:SortOrder %>" runat="server"></asp:Localize>
                                    :
                                </td>
                                <td>
                                    <owc:OwTextBox SkinID="owTextBox" ID="txtSortOrder" runat="server" Width="100px"
                                        Text='<%# Bind("SortOrder") %>' EmptyMessage="<%$ OwR: EnterSortOrder %>">
                                    </owc:OwTextBox>
                                </td>
                            </tr>
                        </table>
                    </div>
                </fieldset>
                <fieldset>
                    <legend><span>
                        <owc:OwR ID="InfoLabel" runat="server" OwText="InfoLabel"></owc:OwR>
                    </span></legend>
                    <div>
                        <table width="100%">
                            <tr>
                                <td class="leftcolumn">
                                    <owc:OwR ID="TitleLabelOwR" runat="server" OwText="TitleLabel" />
                                </td>
                                <td>
                                    <owc:OwTextBox SkinID="OwTextBox" ID="txtTitle" runat="server" Width="680px" OwDefaultValue=""
                                        OwUsedForEdit="False" Text='<%# Bind("Title") %>'>
                                    </owc:OwTextBox>
                                    <asp:RequiredFieldValidator Text="*" ID="RequiredFieldValidator1" runat="server"
                                        ErrorMessage=" <%$ OwR: TitleNotEmpty %>" ControlToValidate="txtTitle"></asp:RequiredFieldValidator>
                                </td>
                            </tr>
                            <tr>
                                <td class="leftcolumn">
                                    <owc:OwR ID="UserOwR" runat="server" OwText="UserLabel" />
                                </td>
                                <td>
                                    <owc:OwTextBox SkinID="owTextBox" ID="txtUser" runat="server" Enabled="False" Width="200px"
                                        OwUsedForEdit="False" Text='<%#Eval("UserID")!=null? (Membership.GetUser(Eval("UserID"))!=null?Membership.GetUser(Eval("UserID")).UserName:"n/a"):"n/a"  %>'>
                                    </owc:OwTextBox>
                                    <owc:OwTextBox SkinID="owTextBox" OwDefaultValue='<%# Membership.GetUser()!=null ? Membership.GetUser().ProviderUserKey:"" %>'
                                        ID="UserLabel" Visible="false" runat="server" Text='<%# Bind("UserID") %>' />
                                    <%--<owc:OwTextBox SkinID="OwTextBox" ID="OwTextBox2" Enabled="false" runat="server" Width="680px" OwDefaultValue=""
                                        OwUsedForEdit="False" Text='<%#Membership.GetUser().UserName%>' >
                                    </owc:OwTextBox>--%>
                                    <%--<owc:OwTextBox SkinID="OwTextBox" ID="UserTb" Visible="false" runat="server" Width="680px" OwDefaultValue='<%#Membership.GetUser().ProviderUserKey %>'
                                        OwUsedForEdit="False" Text='<%# Bind("UserID") %>' >
                                    </owc:OwTextBox>--%>
                                </td>
                            </tr>
                            <tr>
                                <td class="leftcolumn">
                                    <owc:OwR ID="CompanyOwR" runat="server" OwText="CompanyLabel" />
                                </td>
                                <td>
                                    <owc:OwComboBox SkinID="owCombobox" ID="CompanyCbb" runat="server" DataSourceID="OwCompanyOds"
                                        DataTextField="Name" DataValueField="CompanyID" AppendDataBoundItems="True" SelectedValue='<%# Bind("CompanyID") %>'>
                                    </owc:OwComboBox>
                                    <owc:OwOds ID="OwCompanyOds" runat="server" OldValuesParameterFormatString="original_{0}"
                                        OwBLLClassName="" OwSelectMethod="" SelectMethod="OwGetAll" TypeName="Micronet.OpenWeb.Com.BLL.OwCompaniesBLL">
                                        <SelectParameters>
                                            <asp:Parameter Name="sortClause" Type="String" />
                                            <asp:Parameter Name="sortDirection" Type="String" />
                                            <asp:Parameter Name="startRowIndex" Type="Int32" />
                                            <asp:Parameter Name="maximumRows" Type="Int32" />
                                        </SelectParameters>
                                    </owc:OwOds>
                                </td>
                            </tr>
                            <tr>
                                <td class="leftcolumn">
                                    <owc:OwR ID="ForumTheadOwR" runat="server" OwText="ForumTheadLabel" />
                                </td>
                                <td>
                                    <owc:OwComboBox SkinID="owCombobox" ID="OwForumTheadCbb" runat="server" DataSourceID="OwForumTheadOds"
                                        DataTextField="Title" DataValueField="ForumThreadID" AppendDataBoundItems="True"
                                        SelectedValue='<%# Bind("ForumThreadID") %>'>
                                    </owc:OwComboBox>
                                    <owc:OwOds ID="OwForumTheadOds" runat="server" OldValuesParameterFormatString="original_{0}"
                                        OwBLLClassName="" OwSelectMethod="" SelectMethod="OwGetAll" TypeName="Micronet.OpenWeb.Com.BLL.OwForumThreadsBLL">
                                        <SelectParameters>
                                            <asp:Parameter Name="sortClause" Type="String" />
                                            <asp:Parameter Name="sortDirection" Type="String" />
                                            <asp:Parameter Name="startRowIndex" Type="Int32" />
                                            <asp:Parameter Name="maximumRows" Type="Int32" />
                                        </SelectParameters>
                                    </owc:OwOds>
                                </td>
                            </tr>
                            <tr>
                                <td class="leftcolumn">
                                    <owc:OwR ID="OwDetailOwR" runat="server" OwText="DetailLabel" />
                                </td>
                                <td>
                                    <owc:OwEditor SkinID="owEditorFull" ID="txtDetail" runat="server" OwStoragePlace="Common"
                                        OwUsedTarget="Common" Style="position: relative;" Content='<%# Bind("Detail") %>'>
                                    </owc:OwEditor>
                                    <asp:RequiredFieldValidator Text="*" ID="RequiredFieldValidator3" runat="server"
                                        ControlToValidate="txtDetail" ErrorMessage=" <%$ OwR: DetailNotEmpty %>"></asp:RequiredFieldValidator>
                                </td>
                            </tr>
                        </table>
                    </div>
                </fieldset>
                &nbsp; &nbsp; &nbsp;
            </EditItemTemplate>
        </asp:TemplateField>
        <asp:TemplateField ShowHeader="False">
            <EditItemTemplate>
                <fieldset style="position: fixed; bottom: 0px; right: 0px; width: 100%">
                    <legend>
                        <asp:Label ID="Label4" runat="server" EnableViewState="false" Text="<%$ OwR: Action %>" /></legend>
                    <owc:OwButton ID="EditUpdateThenCloseButton" runat="server" CommandName="Update"
                        Text='<%$OwR:Update %>' OnClientClicking="showNotification">
                    </owc:OwButton>
                    &nbsp;
                    <owc:OwConfirmButton ID="EditDeleteButton" runat="server" CausesValidation="True"
                        CommandName="Delete" Text="<%$OwR:Delete %>" SkinID="OwConfirmButton">
                    </owc:OwConfirmButton>
                    &nbsp;<owc:OwButton ID="EditCancelButton" runat="server" CausesValidation="False"
                        CommandName="Cancel" Text="<%$OwR:Cancel %>">
                    </owc:OwButton>
                </fieldset>
            </EditItemTemplate>
            <InsertItemTemplate>
                <fieldset style="position: fixed; bottom: 0px; right: 0px; width: 100%">
                    <legend>
                        <asp:Label ID="Label4" runat="server" EnableViewState="false" Text="<%$ OwR: Action %>" /></legend>
                    <owc:OwButton ID="InsertInsertButton" runat="server" CommandName="Insert" Text="<%$OwR:Insert %>"
                        OnClientClicking="showNotification">
                    </owc:OwButton>
                    &nbsp;<owc:OwButton ID="InsertCancelButton" runat="server" CausesValidation="False"
                        CommandName="Cancel" Text="<%$OwR:Cancel %>">
                    </owc:OwButton>
                </fieldset>
            </InsertItemTemplate>
        </asp:TemplateField>
    </Fields>
</owc:OwDetailsView>
<owc:OwObjectDataSource ID="ForumPostsEditOds" runat="server" DataObjectTypeName="Micronet.OpenWeb.Entity.OwForumPostsEntity"
    DeleteMethod="OwDelete" InsertMethod="OwInsert" OldValuesParameterFormatString="original_{0}"
    SelectMethod="OwGetEntity" TypeName="Micronet.OpenWeb.Com.BLL.OwForumPostsBLL"
    UpdateMethod="OwUpdate">
    <SelectParameters>
        <asp:QueryStringParameter Name="ForumPostID" QueryStringField="<%$ Ow:OwConstants.QueryString.ID %>" />
    </SelectParameters>
</owc:OwObjectDataSource>
